@echo off
chcp 65001 > nul          # 控制台 UTF-8
set LANG=en_US.UTF-8       # 系统语言环境
set LC_CTYPE=en_US.UTF-8   # 字符分类规则

:: 配置需要同步的目录列表
set DIR_LIST=(
    "E:\work_files\projects\cold_rolling_original"
    "E:\work_files\projects\JT热轧冷热集批排程"
)

:: 循环执行同步
for %%d in %DIR_LIST% do (
    call :sync_project "%%d"
)
exit /b

:sync_project
setlocal
set PROJECT_DIR=%~1
set LOG_FILE="%PROJECT_DIR%\sync.log"

echo [%date% %time%] 开始同步: %PROJECT_DIR% >> %LOG_FILE%

python "%~dp0svn_sync.py" --work-dir "%PROJECT_DIR%" >> %LOG_FILE% 2>&1

echo [%date% %time%] 同步完成 >> %LOG_FILE%
endlocal
exit /b